﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace DotNetCSharp
{
    public partial class AgentType
    {
        private const int MouseOffset = 200;
        public void DoFold()
        {
            DelayBeforeAction();
            table.BringWindowToFront();
            Common.Mouse.Click(table.Location.X + foldButtonLocation.X, table.Location.Y + foldButtonLocation.Y);
            Common.Mouse.Move(table.Location.X + foldButtonLocation.X, table.Location.Y + foldButtonLocation.Y + MouseOffset);
        }

        public void DoCheck()
        {
            DelayBeforeAction();
            table.BringWindowToFront();
            Common.Mouse.Click(table.Location.X + checkButtonLocation.X, table.Location.Y + checkButtonLocation.Y);
            Common.Mouse.Move(table.Location.X + checkButtonLocation.X, table.Location.Y + checkButtonLocation.Y + MouseOffset);

        }

        public void DoCall()
        {
            DelayBeforeAction();
            table.BringWindowToFront();
            Common.Mouse.Click(table.Location.X + callButtonLocation.X, table.Location.Y + callButtonLocation.Y);
            Common.Mouse.Move(table.Location.X + callButtonLocation.X, table.Location.Y + callButtonLocation.Y + MouseOffset);

        }

        public void DoRaise()
        {
            DelayBeforeAction();
            table.BringWindowToFront();
            Common.Mouse.Click(table.Location.X + raiseButtonLocation.X, table.Location.Y + raiseButtonLocation.Y);
            Common.Mouse.Move(table.Location.X + raiseButtonLocation.X, table.Location.Y + raiseButtonLocation.Y + MouseOffset);

        }
        private void DelayBeforeAction()
        {
            int time = rand.Next(700, 2500);
            Thread.Sleep(time);
        }
    }
}
